const httpUtil = require('_utils/httpUtil');
import { envConfig } from '../config/index';

class NoteService {
  constructor() {
    this.baseUrl = `${envConfig.XY_API_URL}`;
  }

  queryAll(query) {
    return httpUtil.request({
      url: `${this.baseUrl}/recommend/note?query=${encodeURIComponent(query)}`,
      method: 'GET',
    });
  }

  queryById(id) {
    return httpUtil.request({
      url: `${this.baseUrl}/note/${id}`,
      method: 'GET',
    });
  }
}

const instance = new NoteService();
module.exports = instance;
